package com.heima.schedule;

import com.heima.model.schedule.dtos.Task;
import com.heima.schedule.service.ITaskService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Calendar;

@SpringBootTest
public class test {
    @Autowired
    private ITaskService iTaskService;

    @Test
    private void testTaskOne(){
        Task taskinfo = new Task();
        taskinfo.setTaskType(0);
        taskinfo.setParameters("110");
        taskinfo.setTaskId(123456789L);
        taskinfo.setPriority(1);

        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MINUTE,4);
        taskinfo.setExecuteTime(calendar.getTime());
        iTaskService.TaskAdd(taskinfo);
    }
}
